import request from '@/router/axios'; // 供应商业绩考核

// 列表
export const getList = (current, size, params) => {
  return request({
    url: '/api/hg-quality/suppliercheckachieve/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  })
}

// 删除
export const remove = (ids) => {
  return request({
    url: '/api/hg-quality/suppliercheckachieve/remove',
    method: 'post',
    params: {
      ids
    }
  })
}

// 详情
export const detail = (id,level) => {
  return request({
    url: `/api/hg-quality/suppliercheckachieve/detail`,
    method: "get",
    params: {
      id,
      level
    }
  });
};

// 根据考核分类获取模板名称列表（启用）
export const getTemplateList = (checkType) => {
  return request({
    url: '/api/hg-quality/supplierchecktemplate/templateList',
    method: 'get',
    params: {
      checkType
    }
  })
}

// 根据模板名称获取供应商考核的列表树
export const getTemplateTree = (id) => {
  return request({
    url: '/api/hg-quality/supplierchecktemplate/getTemplateTree',
    method: 'get',
    params: {
      id
    }
  })
}

// 新增
export const submit = (data, type) => {
  return request({
    url: `/api/hg-quality/suppliercheckachieve/${type}`,
    method: 'post',
    data,
  })
}

// 提交
export const startProcess = id => {
  return request({
    url: `/api/hg-quality/suppliercheckachieve/start-process`,
    method: "post",
    params: {
      id
    }
  });
};